<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserProfileTable extends Migration
{
    /**
     * 用户基本资料信息
     */
    public function up(): void
    {
        Schema::create('user_profile', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户ID');
            $table->string('user_profile_id', 12)->default('')->comment('用户账号ID');
            $table->tinyInteger('is_official')->default(0)->comment('是否官方账号：1-是，0-否');
            $table->string('nick_name', 50)->default('')->comment('昵称');
            $table->string('city', 10)->default('')->comment('城市');
            $table->tinyInteger('gender')->default(-1)->comment('性别：1-男，0-女');
            $table->string('birthday', 10)->default('')->comment('生日');
            $table->string('avatar', 30)->default('')->comment('头像');
            $table->string('poster', 300)->default('')->comment('个人资料图');
            $table->string('self_intro', 500)->default('')->comment('自我简介');
            $table->string('voice', 100)->default('')->comment('语音介绍');
            $table->string('longlat', 30)->default('')->comment('经纬度');
            $table->tinyInteger('role')->default(1)->comment('身份：1-普通，2-声优');
            $table->tinyInteger('role_level')->default(1)->comment('等级');
            $table->tinyInteger('online')->default(0)->comment('是否在线：1-在线；0-离线');
            $table->tinyInteger('call_status')->default(0)->comment('语音接听状态：1-空闲');
            $table->tinyInteger('is_recommend')->default(0)->comment('是否推荐：1-是，0-否');
            $table->timestamps();
            $table->unique('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_profile');
    }
}
